package com.boot.DTO;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class EmployeeAddDAO {
    private Long id;
    @NotBlank
    private String name;
    @NotBlank
    private String username;
    @Pattern(regexp = "^1[3-9]\\d{9}$",message = "手机号码格式不对")
    private String phone;
    private String sex;
    @Pattern(regexp =
            "[1-9]\\d{5}(18|19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])\\d{3}[\\dXx]",
            message = "身份证号码格式不对"
    )
    private String idNumber;

    private Long createUser;

    @Override
    public String toString() {
        return "EmployeeAddDAO{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", username='" + username + '\'' +
                ", phone='" + phone + '\'' +
                ", sex='" + sex + '\'' +
                ", idNumber='" + idNumber + '\'' +
                '}';
    }
}
